﻿@model IEnumerable<Century.Model.CMS.DynamicContent>
@{
    Layout = "";
}
<script language="javascript" type="text/javascript">
    function preview(obj) {
        $("#dynamicViewPreview").attr('src', '/content/themes/admin/img/dynamicviews/' + obj + ".png");
    }
</script>
<table>
    <tr>
        <th>
            View Name
        </th>
        <th>
        </th>
    </tr>
    @{ var i = 0; }
    @foreach (var item in Model)
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.ContentName)
            </td>
            <td>
                @* @Html.ActionLink("Select", "DynamicContentSelect", new { id = item.Id, holderId = ViewBag.HolderId, pageId = ViewBag.PageId })*@
                <button type="submit" onclick="javascript:SelectView('@item.Id');" onmouseover="preview('@(item.ControllerName + "." + item.ActionName)');">
                    Select</button>
            </td>
            @if (i == 0)
            {
                <text>
                <td rowspan="@Model.Count()">
                    <img id="dynamicViewPreview" alt="" src="" />
                </td>
                </text>
                i++;
            }
        </tr>
    }
</table>
